#include <cstdio>

int main( )
{
    int t, a, b, c, ret, cas = 1;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d%d%d", &a, &b, &c);
        b += c;
        ret = 0;
        if ( a >= b * 2 )
        {
            ret = b;
            a -= 2 * b;
            ret += ( a + 2 ) / 3 ;
        }
        else
        {
            ret = a / 2;
            b -= a / 2;
            a %= 2;
            if ( a )
            {
                ret++;
                b--;
            }
            ret += ( b + 1 ) / 2;
        }
        printf("Case %d: %d\n", cas++, ret);
    }
    return 0;
}
